home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 23
/
AACD 23.iso
/
AACD
/
Programming
/
tek
/
array
/
stringcatchar.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-05-12
|
530b
|
34 lines
#include "tek/array.h"
/*
** TEKlib
** (C) 2001 TEK neoscientists
** all rights reserved.
**
** TBOOL TStringCatChar(TSTRPTR *s1, TCHAR c)
**
** append single character to a dynamic string.
**
*/
TBOOL TStringCatChar(TSTRPTR *s1, TBYTE c)
{
if (*s1 && c != 0)
{
TARRAY *a1 = *((TARRAY **) s1) - 1;
if (a1->valid)
{
TUINT oldlen = a1->len - 1;
if (TArraySetLen((TAPTR *) s1, oldlen + 2))
{
*(*s1 + oldlen) = c;
*(*s1 + oldlen + 1) = 0;
return TTRUE;
}
return TFALSE;
}
}
return TFALSE;
}